package com.ruoyi.gybj.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.gybj.mapper.ChangeApplyMapper;
import com.ruoyi.gybj.domain.ChangeApply;
import com.ruoyi.gybj.service.IChangeApplyService;

/**
 * 报警变更申请Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-11-19
 */
@Service
public class ChangeApplyServiceImpl implements IChangeApplyService 
{
    @Autowired
    private ChangeApplyMapper changeApplyMapper;

    /**
     * 查询报警变更申请
     * 
     * @param id 报警变更申请主键
     * @return 报警变更申请
     */
    @Override
    public ChangeApply selectChangeApplyById(Long id)
    {
        return changeApplyMapper.selectChangeApplyById(id);
    }

    /**
     * 查询报警变更申请列表
     * 
     * @param changeApply 报警变更申请
     * @return 报警变更申请
     */
    @Override
    public List<ChangeApply> selectChangeApplyList(ChangeApply changeApply)
    {
        return changeApplyMapper.selectChangeApplyList(changeApply);
    }

    /**
     * 新增报警变更申请
     * 
     * @param changeApply 报警变更申请
     * @return 结果
     */
    @Override
    public int insertChangeApply(ChangeApply changeApply)
    {
        changeApply.setCreateTime(DateUtils.getNowDate());
        return changeApplyMapper.insertChangeApply(changeApply);
    }

    /**
     * 修改报警变更申请
     * 
     * @param changeApply 报警变更申请
     * @return 结果
     */
    @Override
    public int updateChangeApply(ChangeApply changeApply)
    {
        changeApply.setUpdateTime(DateUtils.getNowDate());
        return changeApplyMapper.updateChangeApply(changeApply);
    }

    /**
     * 批量删除报警变更申请
     * 
     * @param ids 需要删除的报警变更申请主键
     * @return 结果
     */
    @Override
    public int deleteChangeApplyByIds(Long[] ids)
    {
        return changeApplyMapper.deleteChangeApplyByIds(ids);
    }

    /**
     * 删除报警变更申请信息
     * 
     * @param id 报警变更申请主键
     * @return 结果
     */
    @Override
    public int deleteChangeApplyById(Long id)
    {
        return changeApplyMapper.deleteChangeApplyById(id);
    }
}
